﻿using DevExpress.XtraEditors;
using JXC.ReportPrint;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraReports.UI;
using JXC.Core;
using DevExpress.XtraTab;

namespace JXC.UI.InWarehouse
{
    public partial class CTHTJBForm : DevExpress.XtraEditors.XtraForm
    {
        private APIClient client=new APIClient();
        public CTHTJBForm()
        {
            InitializeComponent();
        }
        /// <summary>
        /// 关闭
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void simpleButton12_Click(object sender, EventArgs e)
        {
            var p = (XtraTabPage)this.Parent;
            if (p != null)
            {
                var tab = (XtraTabControl)p.Parent;
                tab.TabPages.Remove(p);
                tab.SelectedTabPageIndex = tab.TabPages.Count - 1;
            }
            this.Close();
        }
        /// <summary>
        /// 搜索
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void simpleButton13_Click(object sender, EventArgs e)
        {
            gridControl2.DataSource = client.GetCGTHTJBList(textEdit4.Text, textEdit1.Text);
        }

        private void CTHTJBForm_Load(object sender, EventArgs e)
        {
            gridView2.OptionsBehavior.Editable = false;

            gridControl2.DataSource = client.GetCGTHTJBList(textEdit4.Text,textEdit1.Text);
        }

        private void simpleButton11_Click(object sender, EventArgs e)
        {
            frmCGTHTJBPrint p = new frmCGTHTJBPrint(client.GetCGTHTJBList(textEdit4.Text, textEdit1.Text));
            p.ShowPreview();
        }

        private void simpleButton10_Click(object sender, EventArgs e)
        {
            gridControl2.ExportData();
        }
    }
}